package com.mhc.suzuki.manager.impl;

import com.mhc.suzuki.dal.mapper.ext.SettlementCostExtMapper;
import com.mhc.suzuki.dal.model.SettlementCostDO;
import com.mhc.suzuki.dal.query.SettlementCostQuery;
import com.mhc.suzuki.manager.SettlementCostManager;
import com.subaru.common.query.PageResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;


/**
 * Manager for SettlementCost.
 */

@Component
public class SettlementCostManagerImpl implements SettlementCostManager {


    @Autowired
    protected SettlementCostExtMapper settlementCostExtMapper;

    /**
     * query count by query condition.
     */
    @Override
    public int countByQuery(SettlementCostQuery query) {
        return settlementCostExtMapper.countByQuery(query);
    }

    /**
     * delete by query condition.
     */
    @Override
    public int deleteByQuery(SettlementCostQuery query) {
        return settlementCostExtMapper.deleteByQuery(query);
    }

    /**
     * delete by primary key.
     */
    @Override
    public int deleteByPrimaryKey(SettlementCostDO record) {
        return settlementCostExtMapper.deleteByPrimaryKey(record);
    }

    /**
     * insert selective.
     */
    @Override
    public long insertSelective(SettlementCostDO record) {
        return settlementCostExtMapper.insertSelective(record);
    }

    /**
     * select by query condition.
     */
    @Override
    public List<SettlementCostDO> selectByQuery(SettlementCostQuery query) {
        return settlementCostExtMapper.selectByQuery(query);
    }

    /**
     * select by query condition with page.
     */
    @Override
    public PageResult<SettlementCostDO> selectByQueryWithPage(SettlementCostQuery query) {
        PageResult<SettlementCostDO> result = new PageResult<SettlementCostDO>();
        result.setPageSize(query.getPageSize());
        result.setPageNo(query.getPageNo());
        result.setTotalCount(this.countByQuery(query));
        result.setResult(this.selectByQuery(query));
        return result;
    }

    /**
     * select by primary key.
     */
    @Override
    public SettlementCostDO selectByPrimaryKey(Long id) {
        return settlementCostExtMapper.selectByPrimaryKey(id);
    }

    /**
     * select by primary key.
     */
    @Override
    public List<SettlementCostDO> selectByOrderNo(String orderNo) {
        return settlementCostExtMapper.selectByOrderNo(orderNo);
    }

    /**
     * update by query condition selective.
     */
    @Override
    public int updateByQuerySelective(SettlementCostDO record, SettlementCostQuery query) {
        return settlementCostExtMapper.updateByQuerySelective(record, query);
    }

    /**
     * update by query condition.
     */
    @Override
    public int updateByQuery(SettlementCostDO record, SettlementCostQuery query) {

        return settlementCostExtMapper.updateByQuery(record, query);
    }

    /**
     * update by primary key selective.
     */
    @Override
    public int updateByPrimaryKeySelective(SettlementCostDO record) {
        return settlementCostExtMapper.updateByPrimaryKeySelective(record);
    }
}
